package com.wangjiyuan.giftshuo.ui.activity.classify.strategy_details.column_details.all_details;

import com.wangjiyuan.giftshuo.bean.classifybean.strategy.ColumnBean;
import com.wangjiyuan.giftshuo.config.classify.ClassifyURL;
import com.wangjiyuan.giftshuo.http.classityretrofitinterface.RetrofitInterface;
import com.wangjiyuan.giftshuo.utils.OkHttp3Helper;

import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
import rx.Observable;

/**
 * Created by QXL on 2016/11/21.
 */

public class ColumnDetailsModel implements ColumnDetContract.IColumnModel {
    @Override
    public Observable<ColumnBean> getColumDetailsObservable(int limit, int offset) {
        Retrofit retrofit=new Retrofit.Builder()
                .baseUrl(ClassifyURL.BASE_URL)
                .client(OkHttp3Helper.getOkHttpSingletonInstance())
                .addConverterFactory(GsonConverterFactory.create())
                .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
                .build();
        RetrofitInterface retrofitInterface = retrofit.create(RetrofitInterface.class);
        Observable<ColumnBean> columDetailsObservable = retrofitInterface.getColumDetailsObservable(limit, offset);
        return columDetailsObservable;
    }
}
